#include <gui/infopage_screen/InfoPageView.hpp>
#include <gui/infopage_screen/InfoPagePresenter.hpp>

InfoPagePresenter::InfoPagePresenter(InfoPageView& v)
    : view(v)
{

}

void InfoPagePresenter::activate()
{
	InfoPagePresenterState(true);	
}

void InfoPagePresenter::deactivate()
{
	InfoPagePresenterState(false);	
}
void InfoPagePresenter::updateInfo(float newHum, float newTem, uint16_t newALS)
{
		view.updateInfo(newHum, newTem, newALS);	
}
//InfoPagePresenter状态
void InfoPagePresenter::InfoPagePresenterState(bool enable)
{
		if(enable == true)
			model->InfoPageViewTask(true);
		else
			model->InfoPageViewTask(false);
}
//物理按键的页面跳转
void InfoPagePresenter::InfoPageChange(uint8_t newFiveKeyFunc)
{
		view.InfoPageChange(newFiveKeyFunc);	
}